<template>
  <el-table :data="financialProductsList" style="width: 100%">
    <el-table-column label="产品名称" align="center" prop="jrProductName" />
    <el-table-column label="资方" align="center" prop="companyName" />
    <el-table-column label="账户信息" align="center" prop="bankName" />
    <el-table-column label="分期期限" align="center" prop="instalmentPeriod" />
    <el-table-column label="产品类型" align="center">
      <template slot-scope="scope">
        {{scope.row.jrProductType==1?"租房分期":scope.row.jrProductType==2?"收房贷":"应收租约保理"}}
      </template>
    </el-table-column>
    <el-table-column label="授信额度(%)" align="center" prop="creditLine" />
    <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
      <template slot-scope="scope">
        <el-button
          size="size"
          style="color: dodgerblue"
          type="text"
          @click="auditing(scope.row,1)"
        >通过</el-button>
        <el-button
          size="size"
          type="text"
          style="color: red"
          @click="auditing(scope.row,2)"
        >驳回</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>
<script>

import {auditingProduct, listAuditing} from "@/api/financial/product";

export default {
  name: "auditing",
  data(){
    return{
      queryParams:{},
      financialProductsList:[],
    }
  },
  methods:{
    auditing(row,auditing){
      row.auditing = auditing;
      auditingProduct(row).then(response=>{
        this.financialProducts();
        this.$message("审核成功");
      })
    },
    financialProducts(){
      this.queryParams.auditing = 0;
      listAuditing(this.queryParams).then(response=>{
        this.financialProductsList = response.rows;
      })
    }
  },
  created() {
    this.financialProducts();
  }
}
</script>

<style scoped>

</style>
